﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Web.ClientServices.Providers;

namespace CmdletDesigner
{
    /// <summary>
    /// Interaction logic for Login.xaml
    /// </summary>
    public partial class Login : Window, IClientFormsAuthenticationCredentialsProvider
    {
        public Login()
        {
            InitializeComponent();
        }

        public ClientFormsAuthenticationCredentials GetCredentials()
        {

            if (this.ShowDialog() == true)
            {
                return new ClientFormsAuthenticationCredentials(
                        LoginUser.Value, LoginPassword.Value,
                        chkRememberMe.IsChecked ?? false);
            }
            return null;
        }

        private void Click_Ok(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void Click_Cancel(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();                
        }
    }
}
